<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Class: MasterPlaylistController</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Class: MasterPlaylistController</h1>

    




<section>

<header>
    
        <h2><span class="attribs"><span class="type-signature"></span></span>MasterPlaylistController<span class="signature">()</span><span class="type-signature"></span></h2>
        
    
</header>

<article>
    <div class="container-overview">
    
        

    

    
    <h4 class="name" id="MasterPlaylistController"><span class="type-signature"></span>new MasterPlaylistController<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    the master playlist controller controller all interactons
between playlists and segmentloaders. At this time this mainly
involves a master playlist and a series of audio playlists
if they are available
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="master-playlist-controller.js.html">master-playlist-controller.js</a>, <a href="master-playlist-controller.js.html#line220">line 220</a>
    </li></ul></dd>
    

    

    

    
</dl>


















    
    </div>

    
        <h3 class="subsection-title">Extends</h3>

        


    <ul>
        <li>videojs.EventTarget</li>
    </ul>


    

    

    

    

    

    

    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    
    <h4 class="name" id="blacklistCurrentPlaylist"><span class="type-signature"></span>blacklistCurrentPlaylist<span class="signature">(error<span class="signature-attributes">opt</span>, blacklistDuration<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    Blacklists a playlist when an error occurs for a set amount of time
making it unavailable for selection by the rendition selection algorithm
and then forces a new playlist (rendition) selection.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>error</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">an optional error that may include the playlist
to blacklist</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>blacklistDuration</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">an optional number of seconds to blacklist the
playlist</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="master-playlist-controller.js.html">master-playlist-controller.js</a>, <a href="master-playlist-controller.js.html#line858">line 858</a>
    </li></ul></dd>
    

    

    

    
</dl>


















        
            

    

    
    <h4 class="name" id="bufferLowWaterLine"><span class="type-signature"></span>bufferLowWaterLine<span class="signature">()</span><span class="type-signature"> &rarr; {Number}</span></h4>
    

    



<div class="description">
    Calculates the desired buffer low water line based on current time
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="master-playlist-controller.js.html">master-playlist-controller.js</a>, <a href="master-playlist-controller.js.html#line1262">line 1262</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    Desired buffer low water line in seconds
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Number</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="dispose"><span class="type-signature"></span>dispose<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    dispose of the MasterPlaylistController and everything
that it controls
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="master-playlist-controller.js.html">master-playlist-controller.js</a>, <a href="master-playlist-controller.js.html#line1087">line 1087</a>
    </li></ul></dd>
    

    

    

    
</dl>


















        
            

    

    
    <h4 class="name" id="duration"><span class="type-signature"></span>duration<span class="signature">()</span><span class="type-signature"> &rarr; {TimeRange}</span></h4>
    

    



<div class="description">
    get the current duration
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="master-playlist-controller.js.html">master-playlist-controller.js</a>, <a href="master-playlist-controller.js.html#line971">line 971</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    the duration
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">TimeRange</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="goalBufferLength"><span class="type-signature"></span>goalBufferLength<span class="signature">()</span><span class="type-signature"> &rarr; {Number}</span></h4>
    

    



<div class="description">
    Calculates the desired forward buffer length based on current time
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="master-playlist-controller.js.html">master-playlist-controller.js</a>, <a href="master-playlist-controller.js.html#line1248">line 1248</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    Desired forward buffer length in seconds
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Number</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="load"><span class="type-signature"></span>load<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    Call load on our SegmentLoaders
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="master-playlist-controller.js.html">master-playlist-controller.js</a>, <a href="master-playlist-controller.js.html#line654">line 654</a>
    </li></ul></dd>
    

    

    

    
</dl>


















        
            

    

    
    <h4 class="name" id="master"><span class="type-signature"></span>master<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h4>
    

    



<div class="description">
    return the master playlist object if we have one
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="master-playlist-controller.js.html">master-playlist-controller.js</a>, <a href="master-playlist-controller.js.html#line1113">line 1113</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    the master playlist object that we parsed
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Object</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="media"><span class="type-signature"></span>media<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h4>
    

    



<div class="description">
    return the currently selected playlist
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="master-playlist-controller.js.html">master-playlist-controller.js</a>, <a href="master-playlist-controller.js.html#line1122">line 1122</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    the currently selected playlist object that we parsed
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Object</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="pauseLoading"><span class="type-signature"></span>pauseLoading<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    Pause all segment loaders
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="master-playlist-controller.js.html">master-playlist-controller.js</a>, <a href="master-playlist-controller.js.html#line912">line 912</a>
    </li></ul></dd>
    

    

    

    
</dl>


















        
            

    

    
    <h4 class="name" id="play"><span class="type-signature"></span>play<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    Begin playback.
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="master-playlist-controller.js.html">master-playlist-controller.js</a>, <a href="master-playlist-controller.js.html#line686">line 686</a>
    </li></ul></dd>
    

    

    

    
</dl>


















        
            

    

    
    <h4 class="name" id="seekable"><span class="type-signature"></span>seekable<span class="signature">()</span><span class="type-signature"> &rarr; {TimeRange}</span></h4>
    

    



<div class="description">
    check the seekable range
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="master-playlist-controller.js.html">master-playlist-controller.js</a>, <a href="master-playlist-controller.js.html#line988">line 988</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    the seekable range
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">TimeRange</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="setCurrentTime"><span class="type-signature"></span>setCurrentTime<span class="signature">(currentTime)</span><span class="type-signature"> &rarr; {TimeRange}</span></h4>
    

    



<div class="description">
    set the current time on all segment loaders
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>currentTime</code></td>
            

            <td class="type">
            
                
<span class="param-type">TimeRange</span>


            
            </td>

            

            

            <td class="description last">the current time to set</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="master-playlist-controller.js.html">master-playlist-controller.js</a>, <a href="master-playlist-controller.js.html#line928">line 928</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    the current time
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">TimeRange</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="setupFirstPlay"><span class="type-signature"></span>setupFirstPlay<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    Seek to the latest media position if this is a live video and the
player and video are loaded and initialized.
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="master-playlist-controller.js.html">master-playlist-controller.js</a>, <a href="master-playlist-controller.js.html#line714">line 714</a>
    </li></ul></dd>
    

    

    

    
</dl>


















        
            

    

    
    <h4 class="name" id="stuckAtPlaylistEnd_"><span class="type-signature"></span>stuckAtPlaylistEnd_<span class="signature">(playlist)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
    

    



<div class="description">
    Check if a playlist has stopped being updated
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>playlist</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">the media playlist object</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="master-playlist-controller.js.html">master-playlist-controller.js</a>, <a href="master-playlist-controller.js.html#line815">line 815</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    whether the playlist has stopped being updated or not
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="updateDuration"><span class="type-signature"></span>updateDuration<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    Update the player duration
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="master-playlist-controller.js.html">master-playlist-controller.js</a>, <a href="master-playlist-controller.js.html#line1057">line 1057</a>
    </li></ul></dd>
    

    

    

    
</dl>


















        
    

    

    
</article>

</section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="HlsHandler.html">HlsHandler</a></li><li><a href="MasterPlaylistController.html">MasterPlaylistController</a></li><li><a href="module.exports.html">exports</a></li><li><a href="module.exports_module.exports.html">exports</a></li><li><a href="PlaybackWatcher.html">PlaybackWatcher</a></li><li><a href="Representation.html">Representation</a></li><li><a href="SegmentLoader.html">SegmentLoader</a></li><li><a href="SourceUpdater.html">SourceUpdater</a></li><li><a href="VTTSegmentLoader.html">VTTSegmentLoader</a></li></ul><h3>Global</h3><ul><li><a href="global.html#abort">abort</a></li><li><a href="global.html#abortAll">abortAll</a></li><li><a href="global.html#activeGroup">activeGroup</a></li><li><a href="global.html#appendBuffer">appendBuffer</a></li><li><a href="global.html#backwardDuration">backwardDuration</a></li><li><a href="global.html#buffered">buffered</a></li><li><a href="global.html#buffered_">buffered_</a></li><li><a href="global.html#bufferIntersection">bufferIntersection</a></li><li><a href="global.html#byterangeStr">byterangeStr</a></li><li><a href="global.html#calculateBufferedPercent">calculateBufferedPercent</a></li><li><a href="global.html#checkBuffer_">checkBuffer_</a></li><li><a href="global.html#clamp">clamp</a></li><li><a href="global.html#comparePlaylistBandwidth">comparePlaylistBandwidth</a></li><li><a href="global.html#comparePlaylistResolution">comparePlaylistResolution</a></li><li><a href="global.html#createMediaTypes">createMediaTypes</a></li><li><a href="global.html#createTransferableMessage">createTransferableMessage</a></li><li><a href="global.html#DecrypterWorker">DecrypterWorker</a></li><li><a href="global.html#decryptSegment">decryptSegment</a></li><li><a href="global.html#detectEndOfStream">detectEndOfStream</a></li><li><a href="global.html#dispose">dispose</a></li><li><a href="global.html#duration">duration</a></li><li><a href="global.html#enableFunction">enableFunction</a></li><li><a href="global.html#error">error</a></li><li><a href="global.html#estimateSegmentRequestTime">estimateSegmentRequestTime</a></li><li><a href="global.html#findAdCue">findAdCue</a></li><li><a href="global.html#findGaps">findGaps</a></li><li><a href="global.html#findNextRange">findNextRange</a></li><li><a href="global.html#findRange">findRange</a></li><li><a href="global.html#findSoleUncommonTimeRangesEnd">findSoleUncommonTimeRangesEnd</a></li><li><a href="global.html#formatHexString">formatHexString</a></li><li><a href="global.html#forwardDuration">forwardDuration</a></li><li><a href="global.html#getCodecs">getCodecs</a></li><li><a href="global.html#getContainerType">getContainerType</a></li><li><a href="global.html#getExpiredTime">getExpiredTime</a></li><li><a href="global.html#getMediaInfoForTime">getMediaInfoForTime</a></li><li><a href="global.html#getMostImportantError">getMostImportantError</a></li><li><a href="global.html#getProgressStats">getProgressStats</a></li><li><a href="global.html#getRequestStats">getRequestStats</a></li><li><a href="global.html#getSegmentBufferedPercent">getSegmentBufferedPercent</a></li><li><a href="global.html#getSyncPoint">getSyncPoint</a></li><li><a href="global.html#getSyncSegmentCandidate_">getSyncSegmentCandidate_</a></li><li><a href="global.html#handleErrors">handleErrors</a></li><li><a href="global.html#handleHlsLoadedMetadata">handleHlsLoadedMetadata</a></li><li><a href="global.html#handleHlsMediaChange">handleHlsMediaChange</a></li><li><a href="global.html#handleInitSegmentResponse">handleInitSegmentResponse</a></li><li><a href="global.html#handleKeyResponse">handleKeyResponse</a></li><li><a href="global.html#handleProgress">handleProgress</a></li><li><a href="global.html#handleSegmentResponse">handleSegmentResponse</a></li><li><a href="global.html#hasAttribute">hasAttribute</a></li><li><a href="global.html#HlsSourceHandler">HlsSourceHandler</a></li><li><a href="global.html#initSegment">initSegment</a></li><li><a href="global.html#initSegmentId">initSegmentId</a></li><li><a href="global.html#intervalDuration">intervalDuration</a></li><li><a href="global.html#isAes">isAes</a></li><li><a href="global.html#isBlacklisted">isBlacklisted</a></li><li><a href="global.html#isDisabled">isDisabled</a></li><li><a href="global.html#isEnabled">isEnabled</a></li><li><a href="global.html#isFmp4">isFmp4</a></li><li><a href="global.html#isIncompatible">isIncompatible</a></li><li><a href="global.html#lastBandwidthSelector">lastBandwidthSelector</a></li><li><a href="global.html#load">load</a></li><li><a href="global.html#lowestBitrateCompatibleVariantSelector">lowestBitrateCompatibleVariantSelector</a></li><li><a href="global.html#makeMimeTypeString">makeMimeTypeString</a></li><li><a href="global.html#media">media</a></li><li><a href="global.html#mediaSegmentRequest">mediaSegmentRequest</a></li><li><a href="global.html#mimeType">mimeType</a></li><li><a href="global.html#minRebufferMaxBandwidthSelector">minRebufferMaxBandwidthSelector</a></li><li><a href="global.html#movingAverageBandwidthSelector">movingAverageBandwidthSelector</a></li><li><a href="global.html#onGroupChanged">onGroupChanged</a></li><li><a href="global.html#onTrackChanged">onTrackChanged</a></li><li><a href="global.html#parseCodecs">parseCodecs</a></li><li><a href="global.html#pause">pause</a></li><li><a href="global.html#paused">paused</a></li><li><a href="global.html#playlist">playlist</a></li><li><a href="global.html#playlistEnd">playlistEnd</a></li><li><a href="global.html#printableRange">printableRange</a></li><li><a href="global.html#probeSegmentInfo">probeSegmentInfo</a></li><li><a href="global.html#queueCallback_">queueCallback_</a></li><li><a href="global.html#refreshDelay">refreshDelay</a></li><li><a href="global.html#reloadSourceOnError">reloadSourceOnError</a></li><li><a href="global.html#remove">remove</a></li><li><a href="global.html#renditionSelectionMixin">renditionSelectionMixin</a></li><li><a href="global.html#reset">reset</a></li><li><a href="global.html#resetEverything">resetEverything</a></li><li><a href="global.html#resetLoader">resetLoader</a></li><li><a href="global.html#resyncLoader">resyncLoader</a></li><li><a href="global.html#runCallback_">runCallback_</a></li><li><a href="global.html#safeBackBufferTrimTime">safeBackBufferTrimTime</a></li><li><a href="global.html#safeGetComputedStyle">safeGetComputedStyle</a></li><li><a href="global.html#safeLiveIndex">safeLiveIndex</a></li><li><a href="global.html#saveExpiredSegmentInfo">saveExpiredSegmentInfo</a></li><li><a href="global.html#seekable">seekable</a></li><li><a href="global.html#segmentXhrHeaders">segmentXhrHeaders</a></li><li><a href="global.html#setDateTimeMapping">setDateTimeMapping</a></li><li><a href="global.html#setupMediaGroups">setupMediaGroups</a></li><li><a href="global.html#simpleSelector">simpleSelector</a></li><li><a href="global.html#skipEmptySegments_">skipEmptySegments_</a></li><li><a href="global.html#stableSort">stableSort</a></li><li><a href="global.html#start">start</a></li><li><a href="global.html#startLoaders">startLoaders</a></li><li><a href="global.html#stopLoaders">stopLoaders</a></li><li><a href="global.html#sumDurations">sumDurations</a></li><li><a href="global.html#systemBandwidth">systemBandwidth</a></li><li><a href="global.html#textRange">textRange</a></li><li><a href="global.html#timestampOffset">timestampOffset</a></li><li><a href="global.html#timeUntilRebuffer">timeUntilRebuffer</a></li><li><a href="global.html#track">track</a></li><li><a href="global.html#updateMaster">updateMaster</a></li><li><a href="global.html#updateSegments">updateSegments</a></li><li><a href="global.html#updating">updating</a></li><li><a href="global.html#utils">utils</a></li><li><a href="global.html#waitForCompletion">waitForCompletion</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.4</a> on Mon Nov 06 2017 16:03:36 GMT-0500 (EST)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>